package org.chen.model.service.impl;

import java.util.List;
import java.util.Map;

import org.chen.model.dao.EmployeesMapper;
import org.chen.model.entity.Employees;
import org.chen.model.service.EmployeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class EmployeesServiceImpl implements EmployeesService {

	@Autowired
	private EmployeesMapper employeesMapper;

	@Override
	public Integer add(Employees t) {
		return employeesMapper.insertSelective(t);
	}

	@Override
	public Integer update(Employees t) {
		return employeesMapper.updateByPrimaryKeySelective(t);
	}

	@Override
	public Employees queryById(Integer id) {
		return employeesMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Employees> query() {
		return employeesMapper.query();
	}

	@Override
	public Employees login(Employees employees) {
		return employeesMapper.login(employees);
	}

	@Override
	public Integer delete(Integer id) {
		return employeesMapper.deleteByPrimaryKey(id);
	}

	@Override
	public Long queryRowCount() {
		return employeesMapper.queryRowCount();
	}

	/**
	 * @param startIndex
	 * @param pageSize
	 */
	@Override
	public List<Employees> queryByPage(Map<String, Object> pageMap) {
		return employeesMapper.queryByPage(pageMap);
	}

}
